package com.cipe.cmrs.model;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;


@Entity
@Table(name = "restricteduielements")
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
public class RestrictedUiElements extends BaseEntity {

    /**
	 * 
	 */
	private static final long serialVersionUID = -3394143949728219814L;

    @ManyToMany(fetch = FetchType.EAGER)
    @JoinTable(name = "restricteduielements_roleprivileges", joinColumns = { @JoinColumn(name = "uielementid") }, inverseJoinColumns = @JoinColumn(name = "roleid"))
    private Set<Role> roles;
   
    @Column(name = "nameorvalue")
    private String nameOrValue;    
    
    @Column(name = "submenuorform")
    private String subMenuOrForm;

	public Set<Role> getRoles() {
		return roles;
	}

	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}

	public String getNameOrValue() {
		return nameOrValue;
	}

	public void setNameOrValue(String nameOrValue) {
		this.nameOrValue = nameOrValue;
	}

	public String getSubMenuOrForm() {
		return subMenuOrForm;
	}

	public void setSubMenuOrForm(String subMenuOrForm) {
		this.subMenuOrForm = subMenuOrForm;
	}	
}
